
export default {
  state:{
    userInfo:JSON.parse(localStorage.getItem("user"))||null,
    bearPwd:localStorage.getItem("bearPwd")||false,
  },
  mutations:{
    //保存用户信息
    setUserInfo(state,userInfo){
      localStorage.setItem("user",JSON.stringify(userInfo))
      state.userInfo = userInfo;
    },
    setBearPwd(state,bearPwd){
      localStorage.setItem("bearPwd",bearPwd)
      state.bearPwd = bearPwd;
    }
  },
  actions:{
    //保存用户信息
    setUserInfo({commit},userInfo){
      commit("setUserInfo",userInfo);
    },
    //记住密码
    setForgetPwd({commit},bearPwd){
      commit("setBearPwd",bearPwd);
    },
  },
}
